package com.example.design.bilibili.decrator;

/**
 * 装饰者
 */
public class Decorator extends Drink{

    private Drink drink;

    public Decorator(Drink drink) {
        this.drink = drink;
    }

    @Override
    public float cost() {
        return super.getPrice()+drink.cost();
    }

    @Override
    public String getDes() {

        return des+" " + getPrice()+"&&"+drink.getDes();
    }
}
